package com.ibs.hadoop.hbase.service.complaint.impl;

import java.util.List;

import com.ibs.hadoop.hbase.bean.DnsBean;
import com.ibs.hadoop.hbase.bean.QueryBean;
import com.ibs.hadoop.hbase.bean.UseComplaintBaseClass;
import com.ibs.hadoop.hbase.dao.impl.DnsDaoImpl;
import com.ibs.hadoop.hbase.service.complaint.UserComplaintDataQuery;

/**
 * 用户投诉查询
* 源文件名：UserComplaintAttachQuery.java
* 文件版本：1.0.0
* 创建作者：Think
* 创建日期：2016年10月31日
* 修改作者：Think
* 修改日期：2016年10月31日
* 文件描述：TODO
* 版权所有：Copyright 2016 zjhz, Inc. All Rights Reserved.
*/
public class UserComplaintDnsQuery implements UserComplaintDataQuery {

    private static final UserComplaintDnsQuery INSTANCE = new UserComplaintDnsQuery();

    public static UserComplaintDataQuery getInstance() {
        return INSTANCE;
    }

    @Override
    public List<UseComplaintBaseClass> query(QueryBean query) {
        return DnsDaoImpl.getInstance().query(query);
    }

    @Override
    public String parseLine(UseComplaintBaseClass userCompBean) {
        DnsBean param = (DnsBean) userCompBean;

        StringBuilder result = new StringBuilder();
        result.append("Frame").append(":").append(param.getFrame()).append(",");
        result.append("LastFrame").append(":").append(param.getLastFrame()).append(",");
        result.append("Ttime").append(":").append(param.getTtime()).append(",");
        result.append("RecordFileIndex").append(":").append(param.getRecordFileIndex()).append(",");
        result.append("LastFileindex").append(":").append(param.getLastFileindex()).append(",");
        result.append("Apn").append(":").append(param.getApn()).append(",");
        result.append("UserIpValue").append(":").append(param.getUserIpValue()).append(",");
        result.append("DnsserverIpaddr").append(":").append(param.getDnsserverIpaddr()).append(",");
        result.append("SGwIp").append(":").append(param.getSGwIp()).append(",");
        result.append("EnbIp").append(":").append(param.getEnbIp()).append(",");
        result.append("SGw").append(":").append(param.getSGw()).append(",");
        result.append("Enb").append(":").append(param.getEnb()).append(",");
        result.append("Ci").append(":").append(param.getCi()).append(",");
        result.append("Imsi").append(":").append(param.getImsi()).append(",");
        result.append("DomianName").append(":").append(param.getDomianName()).append(",");
        result.append("ReturnIpaddr").append(":").append(param.getReturnIpaddr()).append(",");
        result.append("Responsetime").append(":").append(param.getResponsetime()).append(",");
        result.append("Returncode").append(":").append(param.getReturncode()).append(",");
        result.append("RatType").append(":").append(param.getRatType()).append(",");
        result.append("UlTeid").append(":").append(param.getUlTeid()).append(",");
        result.append("Ttl").append(":").append(param.getTtl()).append(",");
        result.append("Lasttime").append(":").append(param.getLasttime()).append(",");
        result.append("Servicetype").append(":").append(param.getServicetype()).append(",");
        result.append("UserIpB").append(":").append(param.getUserIpB()).append(",");
        result.append("ZoneId").append(":").append(param.getZoneId()).append(",");
        result.append("Tac").append(":").append(param.getTac()).append(",");
        return result.toString();
    }

}
